<!DOCTYPE html>
<script>
    if (window.testRunner) {
        testRunner.setPopupBlockingEnabled(false);
    }
</script>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script>
  var t = async_test('Makes sure that media queries in Link headers correctly evaluate viewport width when <meta content=viewport width=device-width> is specified');
    addEventListener("message", t.step_func(function(event) {
        if (event.data == "zeroloaded")
            assert_unreached("FAIL: media query (width: 0px) matched");
        if (event.data == "nonzeronotloaded")
            assert_unreached("FAIL: media query (min-width: 1px) did not match");
        t.done();
        }, false));
    var w = window.open("resources/enable-viewport-and-refresh.html?media-link-headers-device-width.php");
</script>
